package ControlLayer;
import java.util.ArrayList;

import ModelLayer.*;

public class GroupCtr {

	private GroupRecords groupRecords;
	
	public GroupCtr() {
		groupRecords= GroupRecords.getInstance();
	}
	
	public void createGroup(int paymentTerm, double craftmanDiscount, double quantityDiscount, double pickUpDiscount) throws RealException 
	{
		groupRecords.createGroup(paymentTerm, craftmanDiscount, quantityDiscount, pickUpDiscount);
	}
	
	public Group getGroup(int id) throws RealException 
	{
		return groupRecords.getGroup(id);
	}
	
	public void checkGroup(int id) throws RealException 
	{
		groupRecords.checkGroup(id);
	}
	
	public void updateGroup(int id, int choise, String newValue) throws RealException 
	{
		groupRecords.updateGroup(id, choise, newValue);
	}
	
	public void deleteGroup(int id) throws RealException 
	{
		groupRecords.deleteGroup(id);
	}
	
	public String printGroup(int id) throws RealException
	{
		return groupRecords.printGroup(id);
	}

	public ArrayList<String> getGroups()
	{
		return groupRecords.getGrops();
	}
	
	public ArrayList<Group> getGroupsAL()
	{
		return groupRecords.getGroupsAL();
	}
}


